import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index',
    component: HomeView,
    children: [
      { path: 'index', name: 'index', component: () => import('../views/index.vue') },
      // 客户管理
      // 客户信息管理 clientInfo
      { path: 'clientInfo', name: 'clientInfo', component: () => import('../views/clientManage/clientInfo.vue') },
      // 客户资产管理 clientAssets
      { path: 'clientAssets', name: 'clientAssets', component: () => import('../views/clientManage/clientAssets.vue') },

      // 用户管理
      // 维修人员管理
      { path: 'repairUserManage', name: 'repairUserManage', component: () => import('../views/userManage/repairUserManage.vue') },

      // 资产管理
      // 资产管理
      { path: 'assetsManage', name: 'assetsManage', component: () => import('../views/assetsManage/assetsManage.vue') },
      // 资产类型管理
      { path: 'assetsTypeManage', name: 'assetsTypeManage', component: () => import('../views/assetsManage/assetsTypeManage.vue') },
      // 资产关系管理
      { path: 'assetsBearingManage', name: 'assetsBearingManage', component: () => import('../views/assetsManage/assetsBearingManage.vue') },

      // 事件报警
      // 报警流程设置
      { path: 'alarmProcessSet', name: 'alarmProcessSet', component: () => import('../views/eventAlarm/alarmProcessSet.vue') },
      // 电动车报警
      { path: 'electricVehicleAlarm', name: 'electricVehicleAlarm', component: () => import('../views/eventAlarm/electricVehicleAlarm.vue') },
      // 猫狗报警
      { path: 'catDogAlarm', name: 'catDogAlarm', component: () => import('../views/eventAlarm/catDogAlarm.vue') },
      // 火情报警
      { path: 'fireAlarm', name: 'fireAlarm', component: () => import('../views/eventAlarm/fireAlarm.vue') },
      // 高抛报警
      { path: 'highThrowAlarm', name: 'highThrowAlarm', component: () => import('../views/eventAlarm/highThrowAlarm.vue') },

      // 设备控制
      // 设备开关控制
      { path: 'deviceSwitchControl', name: 'deviceSwitchControl', component: () => import('../views/deviceControl/deviceSwitchControl.vue') },
      // 设备参数下发
      { path: 'deviceDataSending', name: 'deviceDataSending', component: () => import('../views/deviceControl/deviceDataSending.vue') },

      // 设备查询
      // 设备分类
      { path: 'deviceClass', name: 'deviceClass', component: () => import('../views/deviceQuery/deviceClass.vue') },
      // 设备查询
      { path: 'deviceQuery', name: 'deviceQuery', component: () => import('../views/deviceQuery/deviceQuery.vue') },
      // 设备状态查询
      { path: 'deviceTypeQuery', name: 'deviceTypeQuery', component: () => import('../views/deviceQuery/deviceTypeQuery.vue') },
      // 设备明细
      { path: 'deviceDetailed', name: 'deviceDetailed', component: () => import('../views/deviceQuery/deviceDetailed.vue') },

      // 设备周期管理
      // 设备周期设置
      { path: 'deviceCycleSet', name: 'deviceCycleSet', component: () => import('../views/deviceCycleManage/deviceCycleSet.vue') },
      // 运维记录
      { path: 'devOpsRecord', name: 'devOpsRecord', component: () => import('../views/deviceCycleManage/devOpsRecord.vue') },
      // 更新记录
      { path: 'updateRecord', name: 'updateRecord', component: () => import('../views/deviceCycleManage/updateRecord.vue') },
      // 设备超期统计
      { path: 'deviceOverdueCensus', name: 'deviceOverdueCensus', component: () => import('../views/deviceCycleManage/deviceOverdueCensus.vue') },

      //  工单管理
      // 工单触发设置
      { path: 'workOrderTriggerSet', name: 'workOrderTriggerSet', component: () => import('../views/workOrderManage/workOrderTriggerSet.vue') },
      // 工单流程设置
      { path: 'workOrderProcessManage', name: 'workOrderProcessManage', component: () => import('../views/workOrderManage/workOrderProcessManage.vue') },
      // 工单管理
      { path: 'workOrderManage', name: 'workOrderManage', component: () => import('../views/workOrderManage/workOrderManage.vue') },

      //  工单管理(小程序)
      // 工单管理   patrolTaskManage
      { path: 'workOrderManages', name: 'workOrderManages', component: () => import('../views/appletWorkOrderManage/workOrderManages.vue') },
      { path: 'workOrderApprovalManages', name: 'workOrderApprovalManages', component: () => import('../views/appletWorkOrderManage/workOrderApprovalManages.vue') },
      { path: 'patrolTaskManage', name: 'patrolTaskManage', component: () => import('../views/appletWorkOrderManage/patrolTaskManage.vue') },
      { path: 'KnowledgeBaseManage', name: 'KnowledgeBaseManage', component: () => import('../views/appletWorkOrderManage/KnowledgeBaseManage.vue') },
      { path: 'patrolTaskList', name: 'patrolTaskList', component: () => import('../views/appletWorkOrderManage/patrolTaskList.vue') },
      { path: 'warehouseManage', name: 'warehouseManage', component: () => import('../views/appletWorkOrderManage/warehouseManage.vue') },

      // 运维管理 devOpsManage
      // 远程固件更新 remoteFirmwareUpdate
      { path: 'remoteFirmwareUpdate', name: 'remoteFirmwareUpdate', component: () => import('../views/devOpsManage/remoteFirmwareUpdate.vue') },
      // 远程配置更新
      { path: 'remoteConfigUpdate', name: 'remoteConfigUpdate', component: () => import('../views/devOpsManage/remoteConfigUpdate.vue') },
      // 运维工单分配
      { path: 'devOpsWorkOrderDistri', name: 'devOpsWorkOrderDistri', component: () => import('../views/devOpsManage/devOpsWorkOrderDistri.vue') },

      // 数据报表
      // 资产汇总
      { path: 'assetsSummary', name: 'assetsSummary', component: () => import('../views/dataReport/assetsSummary.vue') },
      // 客户汇总
      { path: 'customerSummary', name: 'customerSummary', component: () => import('../views/dataReport/customerSummary.vue') },
      // 设备汇总
      { path: 'deviceSummary', name: 'deviceSummary', component: () => import('../views/dataReport/deviceSummary.vue') },
      // 设备状态汇总
      { path: 'deviceTypeSummary', name: 'deviceTypeSummary', component: () => import('../views/dataReport/deviceTypeSummary.vue') },
      // 设备报警汇总
      { path: 'devicealarmSummary', name: 'devicealarmSummary', component: () => import('../views/dataReport/devicealarmSummary.vue') },

      // 设备日志
      // 设备日志配置
      { path: 'deviceLogConfig', name: 'deviceLogConfig', component: () => import('../views/deviceLog/deviceLogConfig.vue') },
      // 设备状态日志查询
      { path: 'deviceTypeLogQuery', name: 'deviceTypeLogQuery', component: () => import('../views/deviceLog/deviceTypeLogQuery.vue') },
      // 设备状态日志明细
      { path: 'deviceTypeLogDetailed', name: 'deviceTypeLogDetailed', component: () => import('../views/deviceLog/deviceTypeLogDetailed.vue') },

      // 测试
      { path: 'test', name: 'test', component: () => import('../views/test/test.vue') }
    ]
  },

  { path: '/login', name: 'login', component: () => import('../views/login.vue') }
]


const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
